<template>
	<div class="videosBox" v-for="(item_channel, index_channel) in contentList" v-if="contentList.length">
		<p class="videosTitle">{{ item_channel?.channel['0']?.channelName }}</p>
		<div class="videosBtm">
			<div class="videosBtmLeft">
				<a class="block_a" :href="Path + item_channel?.channel[0]?.url" target="_blank">
					<span class="videoTime">
						<i class="iconfont icon-Play-one"></i>
						<span>{{ item_channel?.channel[0]?.extend?.videoUpload_head[0]?.duration || '00:00:00' }}</span>
					</span>
					<div class='img_contanier'>
						<img class="videoImg" :src="getImgPath(item_channel?.channel[0]?.headImag || '')" alt="" />
					</div>
					
					<p class="videosBtmLeftTitle p_descripte">{{ item_channel?.channel[0]?.title }}</p>
				</a>
			</div>
			<div class="videosBtmRight">
				<div class="rightBox" v-for="item in item_channel?.channel.slice(1, item_channel?.channel.length) || []">
					<a class="block_a" :href="Path + item.url" target="_blank">
						<span class="videoTime">
							<i class="iconfont icon-Play-one"></i>
							<span>{{ item.extend?.videoUpload_head[0]?.duration || '00:00:00' }}</span>
						</span>
						<img class="videoImg" :src="getImgPath(item.headImag || '')" alt="" />
						<p class="videosBtmLeftTitle flowHidden p_descripte">{{ item.title }}</p>
					</a>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
export default {
	components: {},
	data() {
		return {
			contentList: [],
			Path: getRootPath()
		};
	},
	mounted() {
		this.getContentOfChannel();
	},
	methods: {
		getContentOfChannel() {
			let arr = ['dj', 'kj6718', 'qc6719', 'ty', 'cj'];
			arr.forEach((item, index) => {
				let param = {
					channelPaths: item,
					orderBy: 2,
					pageNum: 1,
					pageSize: 7,
					isTop: false,
					excludeTypeIdStr: '1302' //排除热门视频
				};
				contentApi.fetchContentOfChannel(param, res => {
					if (res.code == '00000 00000') {
						let obj = {
							channel: res.data.records
						};
						this.contentList[index] = obj;
					} else {
					}
				});
			});
		},
		getImgPath(url) {
			return imgPath(url);
		}
	}
};
</script>

<style>
.videosBox {
	margin-top: 60px;
	width: 1200px;
}
.videosBox .videosTitle {
	height: 30px;
	font-size: 30px;
	font-weight: 600;
	color: #333333;
	line-height: 30px;
}
.videosBox .videosBtm {
	margin-top: 24px;
	display: flex;
}
.videosBox .videosBtm .videosBtmLeft {
	position: relative;
	background-color: #fff;
	width: 460px;
}
.videosBox .videosBtm .videosBtmLeft .videoTime {
	position: absolute;
	top: 218px;
	left: 12px;
	width: 98px;
	height: 28px;
	background: rgba(0,0,0, 0.5);
	border-radius: 50px 50px 50px 50px;
	
	z-index: 2;
	padding: 8px;
	box-sizing: border-box;
	display: flex;
	align-items: center;
}
 .videoTime span {
	font-size: 14px;
	font-family: PingFang SC-Regular, PingFang SC;
	font-weight: 400;
	color: #ffffff;
	margin-left: 4px;
	opacity: 0.5;
}


.videosBox .videosBtm .videosBtmLeft .videoImg {
	width: 460px;
	height: 258px;
	border-radius: 4px 4px 0 0 ;
}
.videosBox .videosBtm .videosBtmLeft .videoImg:hover {
	transform: scale(1.05);
}
.videosBox .videosBtm .videosBtmLeft .videosBtmLeftTitle {
	box-sizing: border-box;
	padding: 24px 22px 20px 24px;
	width: 460px;
	height: 100px;
	background: #FFFFFF;
	box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.06);
	border-radius: 0px 0px 4px 4px;
	opacity: 1;
	font-size: 20px;
	font-family: PingFang SC-Semibold, PingFang SC;
	font-weight: 600;
	color: #333333;
	line-height: 28px;
}
.videosBox .videosBtm .videosBtmLeft .videosBtmLeftTitle:hover{
	color:#FF3333;
}
.videosBox .videosBtm .videosBtmRight {
	display: flex;
	margin-left: 24px;
	flex-wrap: wrap;
	flex: 1;
}
.videosBox .videosBtm .videosBtmRight .rightBox {
	position: relative;
	background-color: #fff;
	margin-left: 25px;
	overflow: hidden;
}
.videosBox .videosBtm .videosBtmRight .rightBox .videoTime {
	position: absolute;
	width: 98px;
	height: 28px;
	background: rgba(0,0,0,0.5);
	border-radius: 50px 50px 50px 50px;
	z-index: 2;
	padding: 8px;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	top: 84px;
	left: 12px;
}
.videosBox .videosBtm .videosBtmRight .rightBox .videoImg {
	width: 222px;
	height: 124px;
	border-radius: 4px;
}
.videosBox .videosBtm .videosBtmRight .rightBox .videoImg:hover {
	transform: scale(1.05);
}
.videosBox .videosBtm .videosBtmRight .rightBox .videosBtmLeftTitle {
	margin-top: 16px;
	width: 222px;
	height: 61px;
	height: 16px;
	font-size: 16px;
	font-weight: 500;
	color: #333333;
	line-height: 16px;
}
.videosBox .videosBtm .videosBtmRight .rightBox .videosBtmLeftTitle:hover{
	color: #FF3333;
}
.videosBox .videosBtm .videosBtmRight .rightBox:nth-child(3n + 1) {
	margin-left: 0;
}
.videosBox .icon-Play-one {
	font-size: 20px;
	color: #fff;
}
.img_contanier{
	overflow: hidden;
	width: 100%;
	height: 258px;
}
</style>
